#pragma once
#include "Condition.h"

class FCCondition: public Condition
{
public:
	FCCondition(int x, int y, int width, int height, char stroke[], int strokeWidth, char fill[]):
		Condition(x, y, width, height, stroke, strokeWidth, fill)
	{
	}

public:
	FCCondition(void);
	~FCCondition(void);

	void Fill(MyGraphics* g)
	{
		MyPoint p1, p2, p3, p4;
		p1.x = _x;
		p1.y = _y + _height / 2;

		p2.x = _x + _width / 2;
		p2.y = _y;

		p3.x = _x + _width;
		p3.y = _y + _height / 2;

		p4.x = _x + _width / 2;
		p4.y = _y + _height;

		MyPoint points[] = {p1, p2, p3, p4};

		// To hinh thoi
		g->FillPolygon(_fill, points, 4);
	}

	void Draw(MyGraphics* g)
	{
		Fill(g);

		// Ve duong xien thu 1
		g->DrawLine(_stroke, _strokeWidth, _x, _y + _height / 2, _x + _width / 2, _y);
		
		// Ve duong xien thu 2
		g->DrawLine(_stroke, _strokeWidth, _x, _y + _height / 2, _x + _width / 2, _y + _height);

		// Ve duong xien thu 3
		g->DrawLine(_stroke, _strokeWidth, _x + _width, _y + _height / 2, _x + _width / 2, _y);

		// Ve duong xien thu 4
		g->DrawLine(_stroke, _strokeWidth, _x + _width, _y + _height / 2, _x + _width / 2, _y + _height);
	}
};

